package com.dragon.modules.yuegou.query.product;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.product.VerifyRecordEntity;
import com.dragon.modules.yuegou.enums.product.VerifyRecordVerifyStatus;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 商品审核信息表 动态查询条件
 * 
 * @author px
 * @date 2019-03-29 16:06:35
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class VerifyRecordQuery extends VerifyRecordEntity implements Query<VerifyRecordEntity> {

    /** 主键ID查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商品ID查询条件 */
	@JsonUnwrapped(prefix = "productId")
	private Condition<String> productIdCondition;

    /** [枚举]审核状态：0-未通过-UNPASS、1-已通过-PASS查询条件 */
	@JsonUnwrapped(prefix = "verifyStatus")
	private Condition<VerifyRecordVerifyStatus> verifyStatusCondition;

    /** 反馈详情查询条件 */
	@JsonUnwrapped(prefix = "detail")
	private Condition<String> detailCondition;

    /** 审核人查询条件 */
	@JsonUnwrapped(prefix = "verifyBy")
	private Condition<String> verifyByCondition;

    /** 审核时间查询条件 */
	@JsonUnwrapped(prefix = "verifyTime")
	private Condition<LocalDateTime> verifyTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public VerifyRecordQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public VerifyRecordQuery(VerifyRecordEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public VerifyRecordQuery(VerifyRecordQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.productIdCondition != null) {
			this.productIdCondition = other.productIdCondition.copy();
		}
		if(other.verifyStatusCondition != null) {
			this.verifyStatusCondition = other.verifyStatusCondition.copy();
		}
		if(other.detailCondition != null) {
			this.detailCondition = other.detailCondition.copy();
		}
		if(other.verifyByCondition != null) {
			this.verifyByCondition = other.verifyByCondition.copy();
		}
		if(other.verifyTimeCondition != null) {
			this.verifyTimeCondition = other.verifyTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<VerifyRecordEntity> toQueryWrapper() {
		QueryWrapper<VerifyRecordEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (productIdCondition != null) {
			productIdCondition.toWrapper(wrapper, COL_PRODUCT_ID);
		}
		if (verifyStatusCondition != null) {
			verifyStatusCondition.toWrapper(wrapper, COL_VERIFY_STATUS);
		}
		if (detailCondition != null) {
			detailCondition.toWrapper(wrapper, COL_DETAIL);
		}
		if (verifyByCondition != null) {
			verifyByCondition.toWrapper(wrapper, COL_VERIFY_BY);
		}
		if (verifyTimeCondition != null) {
			verifyTimeCondition.toWrapper(wrapper, COL_VERIFY_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回主键ID查询条件
	 * 
	 * @return idCondition 主键ID查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取主键ID查询条件
	 * 
	 * @return idCondition 主键ID查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置主键ID查询条件
	 * 
	 * @param idCondition 主键ID查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商品ID查询条件
	 * 
	 * @return productIdCondition 商品ID查询条件
	 */
	public Condition<String> productId() {
		this.productIdCondition = new Condition<>();
		return this.productIdCondition;
	}
	
	/**
	 * 获取商品ID查询条件
	 * 
	 * @return productIdCondition 商品ID查询条件
	 */
	public Condition<String> getProductIdCondition() {
		return productIdCondition;
	}

	/**
	 * 设置商品ID查询条件
	 * 
	 * @param productIdCondition 商品ID查询条件
	 */
	public void setProductIdCondition(Condition<String> productIdCondition) {
		this.productIdCondition = productIdCondition;
	}

	/**
	 * 构造并返回[枚举]审核状态：0-未通过-UNPASS、1-已通过-PASS查询条件
	 * 
	 * @return verifyStatusCondition [枚举]审核状态：0-未通过-UNPASS、1-已通过-PASS查询条件
	 */
	public Condition<VerifyRecordVerifyStatus> verifyStatus() {
		this.verifyStatusCondition = new Condition<>();
		return this.verifyStatusCondition;
	}
	
	/**
	 * 获取[枚举]审核状态：0-未通过-UNPASS、1-已通过-PASS查询条件
	 * 
	 * @return verifyStatusCondition [枚举]审核状态：0-未通过-UNPASS、1-已通过-PASS查询条件
	 */
	public Condition<VerifyRecordVerifyStatus> getVerifyStatusCondition() {
		return verifyStatusCondition;
	}

	/**
	 * 设置[枚举]审核状态：0-未通过-UNPASS、1-已通过-PASS查询条件
	 * 
	 * @param verifyStatusCondition [枚举]审核状态：0-未通过-UNPASS、1-已通过-PASS查询条件
	 */
	public void setVerifyStatusCondition(Condition<VerifyRecordVerifyStatus> verifyStatusCondition) {
		this.verifyStatusCondition = verifyStatusCondition;
	}

	/**
	 * 构造并返回反馈详情查询条件
	 * 
	 * @return detailCondition 反馈详情查询条件
	 */
	public Condition<String> detail() {
		this.detailCondition = new Condition<>();
		return this.detailCondition;
	}
	
	/**
	 * 获取反馈详情查询条件
	 * 
	 * @return detailCondition 反馈详情查询条件
	 */
	public Condition<String> getDetailCondition() {
		return detailCondition;
	}

	/**
	 * 设置反馈详情查询条件
	 * 
	 * @param detailCondition 反馈详情查询条件
	 */
	public void setDetailCondition(Condition<String> detailCondition) {
		this.detailCondition = detailCondition;
	}

	/**
	 * 构造并返回审核人查询条件
	 * 
	 * @return verifyByCondition 审核人查询条件
	 */
	public Condition<String> verifyBy() {
		this.verifyByCondition = new Condition<>();
		return this.verifyByCondition;
	}
	
	/**
	 * 获取审核人查询条件
	 * 
	 * @return verifyByCondition 审核人查询条件
	 */
	public Condition<String> getVerifyByCondition() {
		return verifyByCondition;
	}

	/**
	 * 设置审核人查询条件
	 * 
	 * @param verifyByCondition 审核人查询条件
	 */
	public void setVerifyByCondition(Condition<String> verifyByCondition) {
		this.verifyByCondition = verifyByCondition;
	}

	/**
	 * 构造并返回审核时间查询条件
	 * 
	 * @return verifyTimeCondition 审核时间查询条件
	 */
	public Condition<LocalDateTime> verifyTime() {
		this.verifyTimeCondition = new Condition<>();
		return this.verifyTimeCondition;
	}
	
	/**
	 * 获取审核时间查询条件
	 * 
	 * @return verifyTimeCondition 审核时间查询条件
	 */
	public Condition<LocalDateTime> getVerifyTimeCondition() {
		return verifyTimeCondition;
	}

	/**
	 * 设置审核时间查询条件
	 * 
	 * @param verifyTimeCondition 审核时间查询条件
	 */
	public void setVerifyTimeCondition(Condition<LocalDateTime> verifyTimeCondition) {
		this.verifyTimeCondition = verifyTimeCondition;
	}

}
